<template>
  <div>
    <h1>Count</h1>
    <button @click="getParent($parent)">获取父组件的数据</button>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";
export default defineComponent({
    name:"Count",
})
</script>

<script lang="ts" setup>
 const getParent = (parent:any)=>{
     console.log(parent.num)
 }
</script>

<style scoped>

</style>